package org.example.controller;


import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("/test2")
@Slf4j //日志打印注解
public class TestController2 {

    @RequestMapping("t1")
    public String t1(){
        return "/test.html";
    }

//    @RequestMapping(value = "t2",method = RequestMethod.GET)//多个的时候可以使用{}，单个就我这样写就好
    @GetMapping("/t2")
    @ResponseBody
    public String t2(){
        return null;
    }


    @RequestMapping(value = "t3",method = RequestMethod.POST)
//    @GetMapping("/t3")
    @ResponseBody
    public Object t3(){
        return null;
    }

    @GetMapping("/t4/{classID}/{name}")
    @ResponseBody
    public Object t4(@PathVariable String name,@PathVariable Integer classID){
        log.debug("class id = {} ,name = {}" ,classID,name);
        return null;
    }
}
